/*
 * @Descripttion: 
 * @Author: xgh
 * @Date: 2022-08-30 21:26:54
 * @LastEditors: xgh
 * @LastEditTime: 2022-09-13 14:18:16
 */

import service from "./request";
//注册
export function registerApi(data) {
  return service({
    url: "/register",
    method: "post",
    data:data
  })
}
//登陆
export function loginApi(data) {
  return service({
    url: "/login",
    method: "post",
    data:data
  })
}

//用户登陆错误次数
export function errLoginApi(username) {
  return service({
    url: "/errcount?username="+username,
    method: "get",
  })
}

/* 恢复用户错误登陆次数 */
export function restoreCountApi(username) {
  return service({
    url: "/restorecount?username=" + username,
    method: "get",
  })
}

/* 删除用户错误登陆信息 */
export function deleteErrApi(username) {
  return service({
    url: "/deleteerr?username=" + username,
    method: "delete",
  })
}

/* 获取用户信息 */
export function userInfoApi() {
  return service({
    url: "/userinfo",
    method: "get",
  })
}

/*通过id 获取用户信息 */
export function userInfoByIdApi(id) {
  return service({
    url: "/getuserbyid?id="+id,
    method: "get",
  })
}

export function getAllgoods(id) {
  return service({
    url: "/goods/goodAll",
    method: "get",
  })
}



/* 用户登陆信息 */
export function userLoginInfoApi(id,ip) {
  return service({
    url: "/updatelogininfo?id="+id+"&ip="+ip,
    method: "get",
  })
}

export function getLoginInfoApi(id) {
  return service({
    url: "/getlogininfo?id="+id,
    method: "get",
  })
}

/* 更新上次登陆信息 */
export function updateLogApi(id) {
  return service({
    url: "/updatelogin?id="+id,
    method: "get",
  })
}
export function getAllLoginInfo() {
  return service({
    url: "/alllogininfo",
    method: "get",
  })
}




